<?php

class makeDbBackupTask extends sfBaseTask
{
      protected function configure()
      {
        // // add your own arguments here
        // $this->addArguments(array(
        //   new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),
        // ));

        $this->addOptions(array(
          new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),
          new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),
          new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),
          // add your own options here
        ));

        $this->namespace        = '';
        $this->name             = 'makeDbBackup';
        $this->briefDescription = '';
        $this->detailedDescription = <<<EOF
            The [makeDbBackup|INFO] task does things.
            Call it with:

              [php symfony makeDbBackup|INFO]
EOF;
      }

      protected function execute($arguments = array(), $options = array())
      {
           $databaseManager = new sfDatabaseManager($this->configuration);
           $connection = $databaseManager->getDatabase($options['connection'])->getConnection();
           $BPWriter = new BPWriter();
           $BPWriter->toFile();
      }
}
